import json

import config


def build_json(json_file):
    test_data = []

    with open(file=json_file, mode='rb') as f:
        json_data = json.load(f)

        for case_data in json_data:
            username = case_data.get("username")
            password = case_data.get("password")
            verify_code = case_data.get("verify_code")
            status_code = case_data.get("status_code")
            status = case_data.get("status")
            msg = case_data.get("msg")

            test_data.append((username, password, verify_code, status_code, status, msg))

    return test_data


if __name__ == '__main__':
    print(build_json(config.BASE_PATH + "/data/tpshop_data.json"))
